<?php
////////////////////////////////////////////////////////////////////////////
//                                                                        //
// NOTICE OF COPYRIGHT                                                    //
//                                                                        //
// Dean`s Office for Moodle                                               //
// Электронный деканат                                                    //
// <http://deansoffice.ru/>                                               //
//                                                                        //
// Copyright (C) 2012-2999  Kirill Krasnoschekov (Кирилл Краснощёков)     //
//                                                                        //
// This program is free software: you can redistribute it and/or modify   //
// it under the terms of the GNU General Public License as published by   //
// the Free Software Foundation, either version 3 of the Licensen.        //
//                                                                        //
// This program is distributed in the hope that it will be useful,        //
// but WITHOUT ANY WARRANTY; without even the implied warranty of         //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          //
// GNU General Public License for more details.                           //
//                                                                        //
// You should have received a copy of the GNU General Public License      //
// along with this program.  If not, see <http://www.gnu.org/licenses/>.  //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

/**
 * Array of templates.
 *
 * Contains:
 *   Header
 * 
 *   IndexOpen
 *   IndexElem
 *   IndexClose
 * 
 *   MessageForm
 *   MessageBody
 *   CommentForm
 *   CommentBody
 * 
 *   Footer
 * 
 * Global variables:
 *   title, page
 * 
 * @author Kirill Krasnoschekov
 */
 
$tmpl = array(
/* 
 * Header 
 */
'Header' => 
'
        <!-- Script that hides/shows forms -->
        <script language="javascript">
            function ToggleHidden(id)
            {
                var div = document.getElementById(id);
                if (div.style.display == "block")
                { 
                    div.style.display = "none";
                }
                else
                {
                    div.style.display = "block";
                    div.focus();
                }
            }
        </script>
        
        <!-- Styles -->
        <style type="text/css">
pre.trace {font-size: 10px; display: none;}

/* Message */
div.message 
{
    border-left: 1px solid;
    background-color: #DDDDDD;
    margin-bottom: 10px;
}
div.message > div.timestamp {font-size: 9px;}
div.message > div.name {font-size: 16px;}
div.message > div.text {}
div.message > form {display: none;}
div.message > form * {font-size: 10px;}

form.message * {font-size: 12px;}
form.message > div {}

/* Comment */
div.comment 
{
    margin-left: 30px; 
    border-left: 1px dashed;
    background-color: #F0F0F0;
    margin-bottom: 10px;
}
div.comment > div.timestamp {font-size: 9px;}
div.comment > div.name {font-size: 16px;}
div.comment > div.text {}

form.comment {display: none;}
form.comment * 
{
    margin-left: 30px; 
    font-size: 9px;
}
form.comment > div {}

/* Footer */
div.time {font-size: 9px;}           
        </style>
',
/* 
 * IndexOpen 
 */        
'IndexOpen' => '<div> Pages: ',
/*
 * IndexElem
 * curpage0 is current page indexed from 0 to N-1
 * curpage1 is current page indexed from 1 to N
 */        
'IndexElem' => '<a href="?page={curpage0}"> {curpage1} </a>',
/*
 * IndexClose
 */
'IndexClose' => '</div>',
/*
 * MessageForm
 */
'MessageFormOpen' => '<div style="display:none" id="MsgEditForm{id}">',
'MessageFormClose' => '</div>',
/*
 * MessageBody
 */        
'MessageBody' => 
'        <!-- Message body -->
        <div class="message">
            <!-- Message actions -->
            <div>
                <a href="?page={page}&mode=delete&msgid={id}">Delete</a>
                <a href="javascript:ToggleHidden(\'MsgEditForm{id}\')">Edit</a>
            </div>
            
            <!-- Message contents -->
            <div class="timestamp">{timestamp}</div>
            <div class="name">{name}</div>
            <div class="text">{textbr}</div>
            <div>
                <a href="javascript:ToggleHidden(\'CommentForm{id}\');">Write a comment</a>
            </div>
        </div>
        <!-- /Message body -->',
/*
 * CommentForm
 */
'CommentFormOpen' => '<div style="display:none" id="CommentForm{msgid}">',
'CommentFormClose' => '</div>', 
/*
 * CommentBody
 */
'CommentBody' => 
'        <!-- Comment body -->
        <div class="comment">
            <!-- Comments actions -->
            <div>
                <a href="?page={page}&mode=delete&commentid={id}">Delete</a>
            </div>
 
            <div class="timestamp">{timestamp}</div>
            <div class="name">{name}</div>
            <div class="text">{textbr}</div>
        </div>
        <!-- /Comment body -->',
/*
 * Footer
 */
'Footer' =>
'    <!-- Footer -->
    <div class="time">Elapsed time: {time}</div>
'
);

?>